<?php 
// include_once 'checkAuth.php';
// include_once 'errorcode.php';

function showEmployeeInfo($userName,$userPass)
{
	$output = array();
	$auth = 0;
	if (checkAuthentication($userName, $userPass) == false) {
	
		$r = array();
		$conn = mysqli_connect('localhost', 'root', '', 'paradigmshift_dev');
		$sql = "SELECT * FROM roledate rd,roles r,date d WHERE rd.RoleID=r.RoleID AND rd.dateID = d.dateID ";
		$result = mysqli_query($conn, $sql);
		$row = mysqli_fetch_row($result);
		
		if($result->num_rows>0){
	
			while($row = $result->fetch_assoc()){
				$r[count($r)]= array('roleID' => $row['roleID'] , 'shiftStatus'=>$row['shiftStatus']);
			}
			$error = ErrorCode::successRead;
			$output = array('code' => $error, 'value' => $r);
		}
	} else {
		$error = ErrorCode::authFailRead;
		$output = array('code' => $error);
	}
	return $output;
}

// $r = showEmployeeInfo('user','pass');
// //print_r(json_encode($r));
// print_r($r);

?>
